CC	= gcc
LD	= ld

# The object filr from mask.c
MASK_OBJS		= ../src/mask.o

# local shared and object files
SPHPOLYCOMP_SOFILE	= sphPolyCompIDL.so

SPHPOLYCOMP_OBJS	= ${MASK_OBJS} sphPolyCompIDL.o

SOFILES	= ${SPHPOLYCOMP_SOFILE}
OBJS	= ${SPHPOLYCOMP_OBJS}

INCLUDE = -I../include -I${IDL_DIR}/external
CCFLAGS = ${INCLUDE} -c -g -O3 -fPIC
LDFLAGS = -S -shared
LDLIBS	= -lm

# how to build each shared object file

all: ${SOFILES}

${SPHPOLYCOMP_SOFILE}: ${SPHPOLYCOMP_OBJS}
	@ echo linking $@
	${LD} ${LDFLAGS} ${LDLIBS} -o $@ ${SPHPOLYCOMP_OBJS}
	cp $@ ../../DLM


clean:
	- rm -f ${SOFILES}; 
	- rm -f ${OBJS}; 
	- rm -f ../../DLM/${SPHPOLYCOMP_SOFILE}

.SUFFIXES:
.SUFFIXES: .o .c

.c.o:
	@ echo; echo compiling $<
	${CC} ${CCFLAGS} $<
